package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.MethodMapper;
import com.youlai.boot.system.mapper.QualityMapper;
import com.youlai.boot.system.model.QB.Quality;
import com.youlai.boot.system.service.QualityService;
import org.apache.ibatis.annotations.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class QualityServiceImpl extends ServiceImpl<QualityMapper, Quality> implements QualityService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private QualityMapper qualityMapper;
    @Override
    public boolean saveQuality(Quality quality) {

        quality.setAddtime(LocalDateTime.now());
        return save(quality);
    }

    @Override
    public List<Quality> getAllQuality() {
        return qualityMapper.selectList(null);
    }

    @Override
    public boolean deleteQualityById(Integer id) {
        return qualityMapper.deleteById(id) > 0;
    }
}
